package com.chenyun.mapper;

import com.chenyun.pojo.User;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

public interface UserMapper {
    //根据用户名查询数据
    @Mapper
    @Select("select * from user where username=#{username}")
    User selectByUserName(String username);

    //根据用户名添加数据
    @Mapper
    @Insert("insert into user(username,password,create_time,update_time)" +
            " values(#{username},#{password},now(),now()) ")

    void add(String username, String password);
}
